package custom_types;

public class EmailAddress {
	private String email;

	public EmailAddress() {}
	
	public EmailAddress(String email){
		if (isValid(email))
			this.email = email;
	}
	
	public static boolean isValid(String emailAddress) {
	    return emailAddress.contains(" ") == false && emailAddress.matches(".+@.+\\.[a-z]+");
	}
	
	//Getters
	public String getEmail() { return email; }

	//Setters
	public void setEmail(String email) { this.email = email; }
}
